package com.xdf.whiteaccount.enums;

/**
 * 12月16日 染厂用白坯单据 dye_grey_main 单据类型
 */
public enum BillTypeDyeGrey {
    TRANS_SELF(0,"白坯发本厂","白坯发本厂"),TRANS_SELL(1,"销售出库","销售出库"),
    PUCHASE(2,"外购入库","外购入库"),DYE_TAKE(3,"染厂领料","染厂领料"),
    PD(4,"盘点单","盘点单"),WHITE_OTHER(5,"白坯外发","白坯外发"),
    ;
    private int index;
    private String flag;
    private String desc;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    BillTypeDyeGrey(int index,String flag, String desc) {
        this.index = index;
        this.flag = flag;
        this.desc = desc;
    }

    // 根据索引返回枚举值
    static BillTypeDyeGrey of(int index){
        for(BillTypeDyeGrey item:BillTypeDyeGrey.values()){
            if(item.getIndex() == index) return item;
        }
        return null;
    }
}
